package karileet.meeting.profile.receiver;

import karileet.meeting.profile.MeetingProfile;
import karileet.meeting.profile.ProfileConf;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class NotificationBroadcastReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		String a = intent.getAction();
		MeetingProfile mp = new MeetingProfile(context);
		ProfileConf pc = new ProfileConf(context);
		if (a.equals(ProfileConf.DISABLE)) {
			Log.d(ProfileConf.APP, "Disabling profile");
			mp.disable();
			mp.updateWidget();
		} else if (a.equals(ProfileConf.TOGGLE)) {
			Log.d(ProfileConf.APP, "Toggling vibrate");
			pc.setVibrateEnabled(!pc.isVibrateEnabled());
			mp.update();
		}
	}

}
